jQuery(document).ready(function () {

    $.select = {
        organizationSelect: function (data) {

            $('#organization').select2({
                placeholder: '请选择学院',
                width: "100%",
                data: data,
                minimumResultsForSearch: -1,
                multiple: false,
                ajax: {
                    url: basePath + "studentRegister/getOrganization.do",  // 异步请求地址
                    dataType: "json", // 数据类型
                    type: "GET",
                    processResults: function (data) {
                        let dataOrder = $.map(data, function (obj) {
                            obj.id = obj.organizationId;
                            obj.text = obj.name;
                            return obj;
                        });
                        return {
                            results: dataOrder
                        };
                    }
                }
            });
            if (data) {

                $("#development-form").val(data[0].id).trigger("change");
            }

        }
    };

    $(function () {
        $("#wechatId").val(wechatId);
        $.select.organizationSelect();

        // $.select.developmentSelect();
        // $.userInfoMgr.initButton();
        // $.initTree.initTreePanel();
        // $.initTree.treeResize();
    })
});